package org.geektimes.configuration.microprofile.better.config.source;

import org.eclipse.microprofile.config.spi.ConfigSource;

import java.util.Comparator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @Author: menglinggang
 * @Date: 2021-03-30
 * @Time: 3:53 下午
 */
public class ConfigSourceOrdinalComparator implements Comparator<ConfigSource> {

    public static final ConfigSourceOrdinalComparator INSTANCE = new ConfigSourceOrdinalComparator();

    private ConfigSourceOrdinalComparator() {
    }


    @Override
    public int compare(ConfigSource o1, ConfigSource o2) {
        return Integer.compare(o1.getOrdinal(), o2.getOrdinal());
    }
}
